﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Pampa.CRUD.Configuration;
using Pampa.MVC.Fluent.Crud.Groups;

namespace Pampa.MVC.Fluent.Crud.Items
{
    public class DateCombosItemBuilder<TGroup, TEditor> : EditItemBuilder<TGroup, TEditor, object, DateCombosItemBuilder<TGroup, TEditor>>
    {
        private readonly DateCombosItem _item;

        public DateCombosItemBuilder(DateCombosItem item) : base(item)
        {
            _item = item;
        }

        public DateCombosItemBuilder(GroupBuilder<TGroup, TEditor> group, DateCombosItem item) : base(group, item)
        {
            _item = item;
            _item.YearFrom = 1900;
            _item.YearTo = 2000;
        }

        public DateCombosItemBuilder<TGroup, TEditor> YearFrom(int yearFrom)
        {
            _item.YearFrom = yearFrom;
            return this;
        }

        public DateCombosItemBuilder<TGroup, TEditor> YearTo(int yearTo)
        {
            _item.YearTo = yearTo;
            return this;
        }

        public DateCombosItemBuilder<TGroup, TEditor> NoYear()
        {
            _item.ShowYear = false;
            return this;
        }
    }
}
